@@ -1,5 +1,6 @@  | 
            ||
| 1 | 1 | 
                # -*- coding: utf-8 -*-  | 
            
| 2 | 2 | 
                 | 
            
| 3 | 
                +from django.conf import settings  | 
            |
| 3 | 4 | 
                from django.db import transaction  | 
            
| 4 | 5 | 
                from logit import logit  | 
            
| 5 | 6 | 
                from pywe_miniapp import get_userinfo  | 
            
                @@ -9,11 +10,17 @@ from utils.error.errno_utils import UserStatusCode  | 
            ||
| 9 | 10 | 
                from utils.error.response_utils import response  | 
            
| 10 | 11 | 
                 | 
            
| 11 | 12 | 
                 | 
            
| 13 | 
                +WECHAT = settings.WECHAT  | 
            |
| 14 | 
                +  | 
            |
| 15 | 
                +  | 
            |
| 12 | 16 | 
                @logit  | 
            
| 13 | 17 | 
                @transaction.atomic  | 
            
| 14 | 18 | 
                def get_userinfo_api(request):  | 
            
| 15 | 
                -    appid = request.POST.get('appid', '')
               | 
            |
| 16 | 
                -    secret = request.POST.get('secret', '')
               | 
            |
| 19 | 
                +    wechat = WECHAT.get('MINIAPP', {})
               | 
            |
| 20 | 
                +  | 
            |
| 21 | 
                +    appid = wechat.get('appID')
               | 
            |
| 22 | 
                +    secret = wechat.get('appsecret')
               | 
            |
| 23 | 
                +  | 
            |
| 17 | 24 | 
                     code = request.POST.get('code', '')
               | 
            
| 18 | 25 | 
                     encryptedData = request.POST.get('encryptedData', '')
               | 
            
| 19 | 26 | 
                     iv = request.POST.get('iv', '')
               |